{{#unless @root.keepAllParametersOptional}}
    {{#if queryParams}}
query_params = {}
    {{/if}}
    {{#if headerParams}}
header_params = {}
    {{/if}}
    {{#if pathParams}}
path_params = {}
    {{/if}}
    {{#if cookieParams}}
cookie_params = {}
    {{/if}}
{{/unless}}
{{#if bodyParam}}
{{#with bodyParam}}
_body = {}
{{#each flattenedParamsFromRequestBodyProperties}}
if {{{paramName}}} is not None:
    _body["{{{baseName}}}"] = {{{paramName}}}
{{/each}}
body_param = {{#if isObject}}_body{{else}}body if body is not None else _body{{/if}}
{{/with}}
{{/if}}
{{#each queryParams}}
if {{{paramName}}} is not None:
    query_params["{{{baseName}}}"] = {{{paramName}}}
{{/each}}
{{#each headerParams}}
if {{{paramName}}} is not None:
    header_params["{{{baseName}}}"] = {{{paramName}}}
{{/each}}
{{#each pathParams}}
if {{{paramName}}} is not None:
    path_params["{{{baseName}}}"] = {{{paramName}}}
{{/each}}
{{#each cookieParams}}
if {{{paramName}}} is not None:
    cookie_params["{{{baseName}}}"] = {{{paramName}}}
{{/each}}
